import request from '@/utils/request'

export const getMessage = ({
  senderName,
  receiverName,
  createTime,
  status,
  receiverHeadImage,
  senderHeadImage
}) =>
  request.post('/api/chat/user/saveChatList', {
    senderName,
    receiverName,
    createTime,
    status,
    receiverHeadImage,
    senderHeadImage
  })

export const getList = (username) =>
  request.get(`/api/chat/user/getChatListByUsername?username=${username}`)

export const getHistoryMsg = (username, senderUsername) =>
  request.get(
    `/api/chat/user/getHistoryByUsername?username=${username}&senderUsername=${senderUsername}`
  )
